home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
LIFE_SIM
/
VERSION_
/
MAIN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-12
|
1KB
|
56 lines
/* Cell Proj 1.0 */
#include "MacProto.h"
#include "Cell_Proto.h"
#include "Cell_Definitions.h"
#include "Cell_Variables.h"
EventRecord gTheEvent;
Boolean gWNEImplemented, gDone;
MenuHandle gAppleMenu, gFileMenu, gAbilityMenu;
WindowPtr gCellWindow;
Rect gDragRect, gSizeRect;
DialogPtr gCellInfoDialog;
long gOverExp, gOverPop;
int gCellStatus[ NUMBER_OF_CELLS ];
main()
{
gDone = FALSE;
ToolBoxInit();
WindowInit();
DialogInit();
MenuBarInit();
SetUpDragRect();
DisplayCellWindow();
PlaceRandomCells();
MainLoop();
}
MainLoop()
{
while ( gDone == FALSE )
{
gWNEImplemented = ( NGetTrapAddress( WNE_TRAP_NUM, ToolTrap ) !=
NGetTrapAddress( UMIMPL_TRAP_NUM, ToolTrap ) );
if ( gWNEImplemented )
WaitNextEvent( everyEvent, &gTheEvent, MIN_SLEEP, NIL_MOUSE_REGION );
else
{
SystemTask();
GetNextEvent( everyEvent, &gTheEvent );
}
DoPreCheck();
if ( IsDialogEvent( &gTheEvent ) )
{
HandleDialog();
}
else
HandleEvent();
}
}